class Comment < ActiveRecord::Base
  belongs_to :user
  
  validates_presence_of     :content, :message => "内容不能为空"
  validates_length_of       :content,    :within => 1..200, :too_long => "内容在1到200位之间", :too_short => "内容在1到200位之间"
  
  cattr_reader :per_page
  @@per_page = 25
  
  def before_save
    self.content = self.content.gsub(/^\<(script|frame)/i, '')
  end
end
